package com.wuchao.spring.aop;

import com.wuchao.entity.User;
import com.wuchao.spring.printer.factory.Factory;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author wuchao66
 * @Date 2022/7/1 11:44
 * @Version 1.0
 */
public class TestAop {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext cpac =
                new ClassPathXmlApplicationContext("ApplicationContext.xml");//拿到spring的配置文件
        PointCut pointCut=   (PointCut)cpac.getBean("PointCut");
        User user = new User();
        user.setName("这就是AOP切面编程思想");
        pointCut.show(user);
    }
     @Test
    public void showAop(){
        ClassPathXmlApplicationContext cpac =
                new ClassPathXmlApplicationContext("ApplicationContext.xml");//拿到spring的配置文件
        PointCut1 pointCut1=   (PointCut1)cpac.getBean("PointCut1");
        User user = new User();
        user.setName("这就是AOP切面编程思想143");
        pointCut1.show(user);
    }
   /* @Test
    public void showAop(){
        ClassPathXmlApplicationContext cpac =
                new ClassPathXmlApplicationContext("ApplicationContext.xml");//拿到spring的配置文件
        PointCut pointCut=   (PointCut)cpac.getBean("PointCut");
        User user = new User();
        user.setName("这就是AOP切面编程思想");
        pointCut.show(user);
    }*/
}
